﻿using System;
using System.Collections;

namespace SharpSqlAnalyzer.nodes
{
	// Token: 0x0200028C RID: 652
	public class TColumnDefinition : TParseTreeNode
	{
		// Token: 0x170003DC RID: 988
		// (get) Token: 0x060014FA RID: 5370 RVA: 0x003257A5 File Offset: 0x003239A5
		// (set) Token: 0x060014FB RID: 5371 RVA: 0x003257AD File Offset: 0x003239AD
		public TIdentityClause IdentityClause
		{
			get
			{
				return this._identityClause;
			}
			set
			{
				this._identityClause = value;
			}
		}

		// Token: 0x170003DD RID: 989
		// (get) Token: 0x060014FC RID: 5372 RVA: 0x003257B6 File Offset: 0x003239B6
		// (set) Token: 0x060014FD RID: 5373 RVA: 0x003257BE File Offset: 0x003239BE
		public EGeneratedColumnStoreType generatedColumnStoreType
		{
			get
			{
				return this._eGeneratedColumnStoreType;
			}
			set
			{
				this._eGeneratedColumnStoreType = value;
			}
		}

		// Token: 0x060014FE RID: 5374 RVA: 0x003257C7 File Offset: 0x003239C7
		public void setGeneratedColumnStoreType(TSourceToken st)
		{
			if (st == null)
			{
				return;
			}
			if (st.ToString().Equals("virtual", StringComparison.CurrentCultureIgnoreCase))
			{
				this._eGeneratedColumnStoreType = EGeneratedColumnStoreType.gctVirtual;
				return;
			}
			if (st.ToString().Equals("stored", StringComparison.CurrentCultureIgnoreCase))
			{
				this._eGeneratedColumnStoreType = EGeneratedColumnStoreType.gctStored;
			}
		}

		// Token: 0x170003DE RID: 990
		// (get) Token: 0x060014FF RID: 5375 RVA: 0x00325802 File Offset: 0x00323A02
		// (set) Token: 0x06001500 RID: 5376 RVA: 0x0032580A File Offset: 0x00323A0A
		public bool onNull
		{
			get
			{
				return this._onNull;
			}
			set
			{
				this._onNull = value;
			}
		}

		// Token: 0x170003DF RID: 991
		// (get) Token: 0x06001501 RID: 5377 RVA: 0x00325813 File Offset: 0x00323A13
		// (set) Token: 0x06001502 RID: 5378 RVA: 0x0032581B File Offset: 0x00323A1B
		public TExpression calculatedExpr
		{
			get
			{
				return this._calculatedExpr;
			}
			set
			{
				this._calculatedExpr = value;
			}
		}

		// Token: 0x06001503 RID: 5379 RVA: 0x00325824 File Offset: 0x00323A24
		public void setDefaultExpression(TExpression e)
		{
			this._defaultExpression = e;
		}

		// Token: 0x06001504 RID: 5380 RVA: 0x0032582D File Offset: 0x00323A2D
		public void setNull(bool b)
		{
			this._isNull = b;
		}

		// Token: 0x170003E0 RID: 992
		// (get) Token: 0x06001505 RID: 5381 RVA: 0x00325836 File Offset: 0x00323A36
		// (set) Token: 0x06001506 RID: 5382 RVA: 0x0032583E File Offset: 0x00323A3E
		public virtual TColumnAttributes ColumnAttributes
		{
			get
			{
				return this._columnAttributes;
			}
			set
			{
				this._columnAttributes = value;
			}
		}

		// Token: 0x170003E1 RID: 993
		// (get) Token: 0x06001507 RID: 5383 RVA: 0x00325847 File Offset: 0x00323A47
		// (set) Token: 0x06001508 RID: 5384 RVA: 0x0032584F File Offset: 0x00323A4F
		public virtual TObjectName Comment
		{
			get
			{
				return this._comment;
			}
			set
			{
				this._comment = value;
			}
		}

		// Token: 0x170003E2 RID: 994
		// (get) Token: 0x06001509 RID: 5385 RVA: 0x00325858 File Offset: 0x00323A58
		// (set) Token: 0x0600150A RID: 5386 RVA: 0x00325873 File Offset: 0x00323A73
		private TObjectNameList ColumnReferences
		{
			get
			{
				if (this._columnReferences == null)
				{
					this._columnReferences = new TObjectNameList();
				}
				return this._columnReferences;
			}
			set
			{
				this._columnReferences = value;
			}
		}

		// Token: 0x0600150B RID: 5387 RVA: 0x0032587C File Offset: 0x00323A7C
		public TColumnDefinition()
		{
		}

		// Token: 0x0600150C RID: 5388 RVA: 0x0032588B File Offset: 0x00323A8B
		public TColumnDefinition(TObjectName columnName)
		{
			this._columnName = columnName;
		}

		// Token: 0x0600150D RID: 5389 RVA: 0x003258A1 File Offset: 0x00323AA1
		public override void init(object arg1)
		{
			this._columnName = (TObjectName)arg1;
			this._columnName.ObjectType = 1;
		}

		// Token: 0x0600150E RID: 5390 RVA: 0x003258BB File Offset: 0x00323ABB
		public override void init(object arg1, object arg2)
		{
			this._columnName = (TObjectName)arg1;
			this._columnName.ObjectType = 1;
			if (arg2 != null)
			{
				this._datatype = (TTypeName)arg2;
			}
		}

		// Token: 0x0600150F RID: 5391 RVA: 0x003258E4 File Offset: 0x00323AE4
		public override void init(object arg1, object arg2, object arg3)
		{
			this._columnName = (TObjectName)arg1;
			this._columnName.ObjectType = 1;
			if (arg2 != null)
			{
				this._datatype = (TTypeName)arg2;
			}
			this._constraints = (TConstraintList)arg3;
		}

		// Token: 0x170003E3 RID: 995
		// (get) Token: 0x06001510 RID: 5392 RVA: 0x00325919 File Offset: 0x00323B19
		// (set) Token: 0x06001511 RID: 5393 RVA: 0x00325921 File Offset: 0x00323B21
		public virtual TObjectName ColumnName
		{
			get
			{
				return this._columnName;
			}
			set
			{
				this._columnName = value;
			}
		}

		// Token: 0x170003E4 RID: 996
		// (get) Token: 0x06001513 RID: 5395 RVA: 0x00325933 File Offset: 0x00323B33
		// (set) Token: 0x06001512 RID: 5394 RVA: 0x0032592A File Offset: 0x00323B2A
		public virtual TTypeName Datatype
		{
			get
			{
				return this._datatype;
			}
			set
			{
				this._datatype = value;
			}
		}

		// Token: 0x170003E5 RID: 997
		// (get) Token: 0x06001515 RID: 5397 RVA: 0x00325944 File Offset: 0x00323B44
		// (set) Token: 0x06001514 RID: 5396 RVA: 0x0032593B File Offset: 0x00323B3B
		public virtual TConstraintList Constraints
		{
			get
			{
				return this._constraints;
			}
			set
			{
				this._constraints = value;
			}
		}

		// Token: 0x170003E6 RID: 998
		// (get) Token: 0x06001516 RID: 5398 RVA: 0x0032594C File Offset: 0x00323B4C
		// (set) Token: 0x06001517 RID: 5399 RVA: 0x00325954 File Offset: 0x00323B54
		public bool sparseColumn
		{
			get
			{
				return this._sparse;
			}
			set
			{
				this._sparse = value;
			}
		}

		// Token: 0x170003E7 RID: 999
		// (get) Token: 0x06001518 RID: 5400 RVA: 0x0032595D File Offset: 0x00323B5D
		// (set) Token: 0x06001519 RID: 5401 RVA: 0x00325965 File Offset: 0x00323B65
		public bool filestream
		{
			get
			{
				return this._filestream;
			}
			set
			{
				this._filestream = value;
			}
		}

		// Token: 0x170003E8 RID: 1000
		// (get) Token: 0x0600151A RID: 5402 RVA: 0x0032596E File Offset: 0x00323B6E
		// (set) Token: 0x0600151B RID: 5403 RVA: 0x00325976 File Offset: 0x00323B76
		public bool persistedColumn
		{
			get
			{
				return this._persistedColumn;
			}
			set
			{
				this._persistedColumn = value;
			}
		}

		// Token: 0x170003E9 RID: 1001
		// (get) Token: 0x0600151D RID: 5405 RVA: 0x00325988 File Offset: 0x00323B88
		// (set) Token: 0x0600151C RID: 5404 RVA: 0x0032597F File Offset: 0x00323B7F
		public virtual bool RowGuidCol
		{
			get
			{
				return this._isRowGuidCol;
			}
			set
			{
				this._isRowGuidCol = value;
			}
		}

		// Token: 0x170003EA RID: 1002
		// (get) Token: 0x0600151F RID: 5407 RVA: 0x00325999 File Offset: 0x00323B99
		// (set) Token: 0x0600151E RID: 5406 RVA: 0x00325990 File Offset: 0x00323B90
		public virtual TExpression Seed
		{
			get
			{
				return this._seed;
			}
			set
			{
				this._seed = value;
			}
		}

		// Token: 0x170003EB RID: 1003
		// (get) Token: 0x06001521 RID: 5409 RVA: 0x003259AA File Offset: 0x00323BAA
		// (set) Token: 0x06001520 RID: 5408 RVA: 0x003259A1 File Offset: 0x00323BA1
		public virtual TExpression Increment
		{
			get
			{
				return this._increment;
			}
			set
			{
				this._increment = value;
			}
		}

		// Token: 0x170003EC RID: 1004
		// (get) Token: 0x06001523 RID: 5411 RVA: 0x003259BB File Offset: 0x00323BBB
		// (set) Token: 0x06001522 RID: 5410 RVA: 0x003259B2 File Offset: 0x00323BB2
		public virtual bool Identity
		{
			get
			{
				return this._isIdentity;
			}
			set
			{
				this._isIdentity = value;
			}
		}

		// Token: 0x06001524 RID: 5412 RVA: 0x003259C3 File Offset: 0x00323BC3
		public virtual void addNewConstraint(TConstraint pConstraint)
		{
			if (this._constraints == null)
			{
				this._constraints = new TConstraintList();
			}
			this._constraints.addConstraint(pConstraint);
		}

		// Token: 0x170003ED RID: 1005
		// (get) Token: 0x06001526 RID: 5414 RVA: 0x003259ED File Offset: 0x00323BED
		// (set) Token: 0x06001525 RID: 5413 RVA: 0x003259E4 File Offset: 0x00323BE4
		public virtual TExpression DefaultExpression
		{
			get
			{
				return this._defaultExpression;
			}
			set
			{
				this._defaultExpression = value;
			}
		}

		// Token: 0x170003EE RID: 1006
		// (get) Token: 0x06001528 RID: 5416 RVA: 0x003259FE File Offset: 0x00323BFE
		// (set) Token: 0x06001527 RID: 5415 RVA: 0x003259F5 File Offset: 0x00323BF5
		public virtual bool Null
		{
			get
			{
				return this._isNull;
			}
			set
			{
				this._isNull = value;
			}
		}

		// Token: 0x06001529 RID: 5417 RVA: 0x00325A06 File Offset: 0x00323C06
		public override void accept(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x0600152A RID: 5418 RVA: 0x00325A18 File Offset: 0x00323C18
		public override void acceptChildren(TParseTreeVisitor v)
		{
			v.preVisit(this);
			if (this.ColumnName != null)
			{
				this.ColumnName.acceptChildren(v);
			}
			if (this.Datatype != null)
			{
				this.Datatype.acceptChildren(v);
			}
			if (this.IdentityClause != null)
			{
				this.IdentityClause.acceptChildren(v);
			}
			if (this.Constraints != null)
			{
				foreach (object obj in ((IEnumerable)this.Constraints))
				{
					((TConstraint)obj).acceptChildren(v);
				}
			}
			v.postVisit(this);
		}

		// Token: 0x170003EF RID: 1007
		// (get) Token: 0x0600152C RID: 5420 RVA: 0x00325ACD File Offset: 0x00323CCD
		// (set) Token: 0x0600152B RID: 5419 RVA: 0x00325AC4 File Offset: 0x00323CC4
		public virtual string Encoding
		{
			get
			{
				return this._encoding;
			}
			set
			{
				this._encoding = value;
			}
		}

		// Token: 0x170003F0 RID: 1008
		// (get) Token: 0x0600152E RID: 5422 RVA: 0x00325ADE File Offset: 0x00323CDE
		// (set) Token: 0x0600152D RID: 5421 RVA: 0x00325AD5 File Offset: 0x00323CD5
		public virtual string CollationName
		{
			get
			{
				return this._collationName;
			}
			set
			{
				this._collationName = value;
			}
		}

		// Token: 0x170003F1 RID: 1009
		// (get) Token: 0x0600152F RID: 5423 RVA: 0x00325AE6 File Offset: 0x00323CE6
		// (set) Token: 0x06001530 RID: 5424 RVA: 0x00325AEE File Offset: 0x00323CEE
		public EColumnFormat columnFormat
		{
			get
			{
				return this._columnFormat;
			}
			set
			{
				this._columnFormat = value;
			}
		}

		// Token: 0x170003F2 RID: 1010
		// (get) Token: 0x06001531 RID: 5425 RVA: 0x00325AF7 File Offset: 0x00323CF7
		// (set) Token: 0x06001532 RID: 5426 RVA: 0x00325AFF File Offset: 0x00323CFF
		public EColumnStorage columnStorage
		{
			get
			{
				return this._columnStorage;
			}
			set
			{
				this._columnStorage = value;
			}
		}

		// Token: 0x170003F3 RID: 1011
		// (get) Token: 0x06001533 RID: 5427 RVA: 0x00325B08 File Offset: 0x00323D08
		// (set) Token: 0x06001534 RID: 5428 RVA: 0x00325B10 File Offset: 0x00323D10
		public TConstant columnComment
		{
			get
			{
				return this._columnComment;
			}
			set
			{
				this._columnComment = value;
			}
		}

		// Token: 0x170003F4 RID: 1012
		// (get) Token: 0x06001536 RID: 5430 RVA: 0x00325B22 File Offset: 0x00323D22
		// (set) Token: 0x06001535 RID: 5429 RVA: 0x00325B19 File Offset: 0x00323D19
		public virtual TExpression ComputedColumnExpression
		{
			get
			{
				return this._computedColumnExpression;
			}
			set
			{
				this._computedColumnExpression = value;
			}
		}

		// Token: 0x06001537 RID: 5431 RVA: 0x00325B2C File Offset: 0x00323D2C
		public override void doParse(TCustomSqlStatement psql, ESqlClause plocation)
		{
			if (this._constraints == null)
			{
				return;
			}
			for (int i = this._constraints.size() - 1; i >= 0; i--)
			{
				this._constraints.getConstraint(i).ConstraintLevel = 1;
				switch (this._constraints.getConstraint(i).Constraint_type)
				{
				case EConstraintType.fake_null:
					this.Null = true;
					this._constraints.removeConstraint(i);
					break;
				case EConstraintType.fake_collate:
					this._collationName = this._constraints.getConstraint(i).endToken.ToString();
					this._constraints.removeConstraint(i);
					break;
				case EConstraintType.fake_identity:
					this._isIdentity = true;
					this._seed = this._constraints.getConstraint(i).Seed;
					this._increment = this._constraints.getConstraint(i).Increment;
					this._constraints.removeConstraint(i);
					break;
				case EConstraintType.fake_rowguidcol:
					this._isRowGuidCol = true;
					this._constraints.removeConstraint(i);
					break;
				case EConstraintType.fake_comment:
					this._columnComment = this._constraints.getConstraint(i).constraintComment;
					this._constraints.removeConstraint(i);
					break;
				case EConstraintType.fake_column_format_dynamic:
					this._columnFormat = EColumnFormat.cfDynamic;
					this._constraints.removeConstraint(i);
					break;
				case EConstraintType.fake_column_format_default:
					this._columnFormat = EColumnFormat.cfDefault;
					this._constraints.removeConstraint(i);
					break;
				case EConstraintType.fake_column_format_fixed:
					this._columnFormat = EColumnFormat.cfFixed;
					this._constraints.removeConstraint(i);
					break;
				case EConstraintType.fake_column_storage_memory:
					this._columnStorage = EColumnStorage.csMemory;
					this._constraints.removeConstraint(i);
					break;
				case EConstraintType.fake_column_storage_disk:
					this._columnStorage = EColumnStorage.csDisk;
					this._constraints.removeConstraint(i);
					break;
				case EConstraintType.fake_column_storage_default:
					this._columnStorage = EColumnStorage.csDefault;
					this._constraints.removeConstraint(i);
					break;
				case EConstraintType.fake_column_generated_as_identity:
					this._constraints.removeConstraint(i);
					break;
				}
			}
			for (int j = 0; j < this._constraints.size(); j++)
			{
				this._constraints.getConstraint(j).doParse(psql, plocation);
			}
		}

		// Token: 0x0400170D RID: 5901
		private TIdentityClause _identityClause;

		// Token: 0x0400170E RID: 5902
		private EGeneratedColumnStoreType _eGeneratedColumnStoreType;

		// Token: 0x0400170F RID: 5903
		private bool _onNull;

		// Token: 0x04001710 RID: 5904
		private TExpression _calculatedExpr;

		// Token: 0x04001711 RID: 5905
		private TColumnAttributes _columnAttributes;

		// Token: 0x04001712 RID: 5906
		private TObjectName _comment;

		// Token: 0x04001713 RID: 5907
		private TObjectName _columnName;

		// Token: 0x04001714 RID: 5908
		private TObjectNameList _columnReferences;

		// Token: 0x04001715 RID: 5909
		private bool _sparse;

		// Token: 0x04001716 RID: 5910
		private bool _filestream;

		// Token: 0x04001717 RID: 5911
		private bool _persistedColumn;

		// Token: 0x04001718 RID: 5912
		private TTypeName _datatype;

		// Token: 0x04001719 RID: 5913
		private TConstraintList _constraints;

		// Token: 0x0400171A RID: 5914
		private TExpression _defaultExpression;

		// Token: 0x0400171B RID: 5915
		private bool _isNull;

		// Token: 0x0400171C RID: 5916
		private bool _isRowGuidCol;

		// Token: 0x0400171D RID: 5917
		private string _encoding;

		// Token: 0x0400171E RID: 5918
		private string _collationName;

		// Token: 0x0400171F RID: 5919
		private TExpression _seed;

		// Token: 0x04001720 RID: 5920
		private TExpression _increment;

		// Token: 0x04001721 RID: 5921
		private bool _isIdentity;

		// Token: 0x04001722 RID: 5922
		private EColumnFormat _columnFormat;

		// Token: 0x04001723 RID: 5923
		private EColumnStorage _columnStorage = EColumnStorage.csNotSpecified;

		// Token: 0x04001724 RID: 5924
		private TConstant _columnComment;

		// Token: 0x04001725 RID: 5925
		private TExpression _computedColumnExpression;
	}
}
